﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using Styx;
using Styx.Helpers;
using Styx.WoWInternals;

namespace rndbuddy
{
    static class GuildInviteAccepter
    {
        public static void GuildInvite(object sender, LuaEventArgs e)
        {
            string GuildName;
            int GuildLevel;

            GuildName = e.Args[1].ToString();
            GuildLevel = Convert.ToInt32(e.Args[2]);


            if (GuildLevel >= settings.GuildLevelToJoin)
            {
                rndbuddy.log("Accepting Guild Invite "+ GuildName+" "+GuildLevel);
                Lua.DoString("AcceptGuild()");
            }
            else
            {
                rndbuddy.log("Declining Guild Invite "+ GuildName+" "+GuildLevel);
                Lua.DoString("DeclineGuild()");
            }
            Lua.DoString("StaticPopup_Hide(\"GUILD_INVITE_REQUEST\")");
        }
    }
}
